/****************************************************************************/
/* NAME:           Hal_OutputManagement.h                                   */
/* PURPOSE:        Manage all basic output                                  */
/* CREATED_BY:     Vyx                                                      */
/* CREATION_DATE:  03/07/2012                                               */
/************************************** (C) Copyright 2012 AquaLink *********/

#ifndef OUTPUT_MANAGEMENT_DEF
#define OUTPUT_MANAGEMENT_DEF

#include "Hal_GenericConfig.h"
#include "stm32f10x.h"
#include "stm32_config.h"
#include "main.h"

#define OSMOLATOR_PUMP   0

#define LIGHT_OUT_1      10
#define LIGHT_OUT_2      11
#define LIGHT_OUT_3      12
#define LIGHT_OUT_4      13
#define LIGHT_OUT_5      14
#define LIGHT_OUT_6      15
#define LIGHT_OUT_7      16
#define LIGHT_OUT_8      17
/*
#define LEDSPWM_1        20
#define LEDSPWM_2        21
#define LEDSPWM_3        22
#define LEDSPWM_4        23
#define LEDSPWM_5        24
#define LEDSPWM_6        25
#define LEDSPWM_7        26
#define LEDSPWM_8        27
*/
#define OSCILLATOR_OUT_1 30
#define OSCILLATOR_OUT_2 31

#define USART_1_RX       40

#define SPI_CS           50
#define SPI_SCK          51
#define SPI_MOSI         52

#define OUTPUT_LINES_1    60
#define OUTPUT_LINES_2    61
#define OUTPUT_LINES_3    62
#define OUTPUT_LINES_4    63
#define OUTPUT_LINES_5    64
#define OUTPUT_LINES_6    65
#define OUTPUT_LINES_7    66
#define OUTPUT_LINES_8    67
#define OUTPUT_LINES_9    68
#define OUTPUT_LINES_10   69

#define OUTPUT_STEPPER_1  70
#define OUTPUT_STEPPER_2  71
#define OUTPUT_STEPPER_3  72
#define OUTPUT_STEPPER_4  73


typedef struct
{
  uint8_t           OutputName;
  GPIO_TypeDef     *OutputGpio;
  uint16_t          OutputPin;
  GPIOMode_TypeDef  OutputMode;
}Output_def_t;

/**
  * @brief  Main function of output management.
  *         This function is execute one time at the start.
  * @param  none
  * @retval None
  */
void vTaskCTRL_OutputManagementInit(void);

/**
  * @brief  Get the value of selected output.
  * @param  Name of output
  * @retval Value of output (TRUE or FALSE)
  */
bool OUTPUT_GetOutputValue(uint8_t OutputName);

/**
  * @brief  Set the value of selected output.
  * @param  Name of output
  * @retval Value of output (TRUE or FALSE)
  */
void OUTPUT_SetOutputValue(uint8_t OutputName, bool OutputValue);

#endif /* OUTPUT_MANAGEMENT_DEF */
